package jsyf.oa.entity.contract;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.List;

/**
 * Created by Administrator on 2018/8/16 0016.
 */

@Entity
@Table(name = "t_con_financingment", schema = "oa", catalog = "")
public class FinancingEntity extends BaseEntity {
    private String mainId = "";
    private String financingDate = "";//  `FINANCING_DATE`
    private BigDecimal financingMoney = new BigDecimal("0.00");//   `FINANCING_MONEY`
    private String advancesDate = "";//  `ADVANCES_DATE`  '担保人住所地',
    private BigDecimal advancesMoney = new BigDecimal("0.00");//  `ADVANCES_MONEY`   '担保人电话',
    private Integer sortNo = 0;
    private String repaymentAttachName = "";
    private String repaymentAttachUrl = "";
    private BigDecimal remainingArrears = new BigDecimal("0.00");//剩余欠款
    private String remark = "";
    private String createUserId;
    private String createUserName;
    private String createDate;
    private Integer type= 2;
    private String parentId="0";
    private BigDecimal jroverduePenalty = new BigDecimal("0.00");//金融公司逾期罚息
    private BigDecimal jrPenalty = new BigDecimal("0.00");//金融公司实收罚息
    private BigDecimal qkRepayment = new BigDecimal("0.00");//欠款还款金额
    private BigDecimal yqRepayment = new BigDecimal("0.00");//逾期还款金额
    private BigDecimal everyRemainingArrear = new BigDecimal("0.00");
    private Integer hkType =1;
    private BigDecimal freeMoney; //免息金额

    public Integer getHkType() {
        return hkType;
    }

    public void setHkType(Integer hkType) {
        this.hkType = hkType;
    }

    private List<FinancingEntity> repaymentParentList;//跟踪列表再套list
    public String getMainId() {
        return mainId;
    }

    public void setMainId(String mainId) {
        this.mainId = mainId;
    }

    public String getFinancingDate() {
        return financingDate;
    }

    public void setFinancingDate(String financingDate) {
        this.financingDate = financingDate;
    }

    public String getAdvancesDate() {
        return advancesDate;
    }

    public void setAdvancesDate(String advancesDate) {
        this.advancesDate = advancesDate;
    }

    public BigDecimal getFinancingMoney() {
        return financingMoney;
    }

    public void setFinancingMoney(BigDecimal financingMoney) {
        this.financingMoney = financingMoney;
    }

    public BigDecimal getAdvancesMoney() {
        return advancesMoney;
    }

    public void setAdvancesMoney(BigDecimal advancesMoney) {
        this.advancesMoney = advancesMoney;
    }

    public Integer getSortNo() {
        return sortNo;
    }

    public void setSortNo(Integer sortNo) {
        this.sortNo = sortNo;
    }

    public String getRepaymentAttachName() {
        return repaymentAttachName;
    }

    public void setRepaymentAttachName(String repaymentAttachName) {
        this.repaymentAttachName = repaymentAttachName;
    }

    public String getRepaymentAttachUrl() {
        return repaymentAttachUrl;
    }

    public void setRepaymentAttachUrl(String repaymentAttachUrl) {
        this.repaymentAttachUrl = repaymentAttachUrl;
    }

    public BigDecimal getRemainingArrears() {
        return remainingArrears;
    }

    public void setRemainingArrears(BigDecimal remainingArrears) {
        this.remainingArrears = remainingArrears;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public BigDecimal getJroverduePenalty() {
        return jroverduePenalty;
    }

    public void setJroverduePenalty(BigDecimal jroverduePenalty) {
        this.jroverduePenalty = jroverduePenalty;
    }

    public BigDecimal getJrPenalty() {
        return jrPenalty;
    }

    public void setJrPenalty(BigDecimal jrPenalty) {
        this.jrPenalty = jrPenalty;
    }

    public BigDecimal getQkRepayment() {
        return qkRepayment;
    }

    public void setQkRepayment(BigDecimal qkRepayment) {
        this.qkRepayment = qkRepayment;
    }

    public BigDecimal getYqRepayment() {
        return yqRepayment;
    }

    public void setYqRepayment(BigDecimal yqRepayment) {
        this.yqRepayment = yqRepayment;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public List<FinancingEntity> getRepaymentParentList() {
        return repaymentParentList;
    }

    public void setRepaymentParentList(List<FinancingEntity> repaymentParentList) {
        this.repaymentParentList = repaymentParentList;
    }

    public BigDecimal getEveryRemainingArrear() {
        return everyRemainingArrear;
    }

    public void setEveryRemainingArrear(BigDecimal everyRemainingArrear) {
        this.everyRemainingArrear = everyRemainingArrear;
    }

    public BigDecimal getFreeMoney() {
        return freeMoney;
    }

    public void setFreeMoney(BigDecimal freeMoney) {
        this.freeMoney = freeMoney;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("MAIN_ID", getMainId());
        obj.put("FINANCING_DATE", getFinancingDate());
        obj.put("FINANCING_MONEY", getFinancingMoney());
        obj.put("ADVANCES_DATE", getAdvancesDate());
        obj.put("ADVANCES_MONEY", getAdvancesMoney());
        obj.put("SORT_NO", getSortNo());
        obj.put("REPAYMENT_ATTACH_NAME", getRepaymentAttachName());
        obj.put("REPAYMENT_ATTACH_URL", getRepaymentAttachUrl());
        obj.put("REMAINING_ARREARS", getRemainingArrears());
        obj.put("JR_OVERDUE_PENALTY", getJroverduePenalty());
        obj.put("JR_PENALTY", getJrPenalty());
        obj.put("CREATE_USER_ID", getCreateUserId());
        obj.put("CREATE_USER_NAME", getCreateUserName());
        obj.put("CREATE_DATE", getCreateDate());
        obj.put("CREATE_TIME", getCreateTime());
        obj.put("REMARK", getRemark());
        obj.put("QK_REPAYMENT", getQkRepayment());
        obj.put("YQ_REPAYMENT", getYqRepayment());
        obj.put("TYPE", getType());
        obj.put("PARENT_ID", getParentId());
        obj.put("HK_TYPE", getHkType());
        obj.put("FREE_MONEY",getFreeMoney());
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_con_financingment";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("MAIN_ID", "mainId");
        obj.put("FINANCING_DATE", "financingDate");
        obj.put("FINANCING_MONEY", "financingMoney");
        obj.put("ADVANCES_DATE", "advancesDate");
        obj.put("ADVANCES_MONEY", "advancesMoney");
        obj.put("SORT_NO", "sortNo");
        obj.put("REPAYMENT_ATTACH_NAME", "repaymentAttachName");
        obj.put("REPAYMENT_ATTACH_URL", "repaymentAttachUrl");
        obj.put("REMAINING_ARREARS", "remainingArrears");
        obj.put("JR_OVERDUE_PENALTY", "jroverduePenalty");
        obj.put("JR_PENALTY", "jrPenalty");
        obj.put("CREATE_USER_ID", "createUserId");
        obj.put("CREATE_USER_NAME", "createUserName");
        obj.put("CREATE_DATE", "createDate");
        obj.put("CREATE_TIME", "createTime");
        obj.put("REMARK", "remark");
        obj.put("QK_REPAYMENT", "qkRepayment");
        obj.put("YQ_REPAYMENT", "yqRepayment");
        obj.put("TYPE", "type");
        obj.put("PARENT_ID", "parentId");
        obj.put("HK_TYPE", "hkType");
        obj.put("FREE_MONEY","freeMoney");

        return obj;
    }
}
